package day06test;

import java.util.Random;
import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        //Guessing
        Random random=new Random();
        int num=random.nextInt(100)+1;
        System.out.println("作弊："+num);
        Scanner scan=new Scanner(System.in);
        while (true){
            System.out.println("请guess一个整数:");
            int gues=scan.nextInt();
            if (gues>num){
                System.out.println("猜大了");
            } else if (gues<num) {
                System.out.println("猜小了");
            }else {
                System.out.println("猜对了");
                break;
            }
        }
    }
}
